<?php
    drupal_add_js('js/jquery.validate.min.js');
    drupal_add_js('js/script.category.js');
?>
<div id="error">
    <ul></ul>
</div>
<form name="add_cprice" id="add_cprice" action="" method="POST">
    <div>
        <div class="node-form">
            <div class="standard">
                <div class="form-item">
                    <label for="cprice_name">Tên danh mục: <span title="Trường bắt buộc." class="form-required">*</span></label>
                    <input type="text" value="<?php if($data['price']) echo $data['price']->cprice_name ?>" size="60" id="cprice_name" name="cprice_name" maxlength="100">
                </div>
                
                <div class="form-item">
                    <label for="gia">Giá từ: <span title="Trường bắt buộc." class="form-required">*</span></label>
                    <input type="text" value="<?php if($data['price']) echo $data['price']->cprice_min ?>" size="25" id="cprice_min" name="cprice_min" maxlength="11">
                    đến
                    <input type="text" value="<?php if($data['price']) echo $data['price']->cprice_max ?>" size="25" id="cprice_max" name="cprice_max" maxlength="11">
                </div>
                <?php
                    if (user_access('admin block')) {
                ?>
                <div class="form-item">
                    <label for="cprice_status">Trạng thái:</label>
                    <select id="cprice_status" name="cprice_status">
                        <option value="<?php echo CPRICE_STATUS_SHOW ?>">Hiển thị</option>
                        <option <?php if(!empty($data['price']) && $data['price']->cprice_status == CPRICE_STATUS_HIDE) echo 'selected="true"'; ?> value="<?php echo CPRICE_STATUS_HIDE ?>">Không hiển thị</option>
                    </select>
                </div>
                <?php        
                    } else {
                        echo '<input type="hidden" value="' . ($data['price']->cprice_status == CPRICE_STATUS_HIDE ? CPRICE_STATUS_HIDE : CPRICE_STATUS_SHOW) . '" id="cprice_status" name="cprice_status" readonly="true" />';
                    }
                ?>
                <div class="form-item">
                    <input type="submit" value="Lưu" />
                    <input type="reset" rel="add_cprice" value="Nhập lại" />                
                    <?php echo l('Quay lại', 'back-end/filter/price/' . arg(3)) ?>
                </div>
            </div>
        </div>
    </div>
</form>